<?php /* @var $view Model3_View */ ?>
<div class="contentBox">
    <div class="contentBoxTop">
        <h3>Alta de eventos</h3>
    </div>
    <div class="innerContent">        
        <h4>Agregar un evento</h4>        
        <?php $edit = ($view->event) ? $view->event->getId() : 0;  //Si se esta editando ?>
        <form method="post" action="<?php echo $view->url(array('module' => 'EventAdmin', 'controller' => 'Events', 'action' => 'addEvent', 'edit' => $edit)); ?>" >
            <table>
                <tr>
                    <td>
                        <?php $username = ($view->event) ? $view->event->getEventUser()->getUsername() : ''; ?>
                        <label for="userMail">E-mail : </label>
                    </td>
                    <td>
                        <input type="text" name="userMail" value="<?php echo $username; ?>" />        
                    </td>
                </tr>
                <tr>
                    <td>
                        <?php $firstName = ($view->event) ? $view->event->getEventUser()->getFirstName() : ''; ?>
                        <label for="userFirstName">Nombre : </label>
                    </td>
                    <td>
                        <input type="text" name="userFirstName" value="<?php echo $firstName; ?>"/>
                    </td>
                </tr>
                <tr>
                    <td>
                        <?php $lastName = ($view->event) ? $view->event->getEventUser()->getLastName() : ''; ?>
                        <label for="userLastName">Apellido : </label>
                    </td>
                    <td>
                        <input type="text" name="userLastName" value="<?php echo $lastName; ?>"/>
                    </td>
                </tr>
                <tr>
                    <td>
                        <?php $nameEvent = ($view->event) ? $view->event->getNameEvent() : ''; ?>
                        <label for="nameEvent">Nombre del Evento : </label>
                    </td>
                    <td>
                        <input type="text" name="nameEvent" value="<?php echo $nameEvent; ?>"/>
                    </td>
                </tr>
                <tr>
                    <td>

                        <label for="restrictedEvent">Restricciones del evento : </label>
                    </td>
                    <td>
                        <select name="restrictedEvent" class="select-medium">
                            <option value="1"  <?php echo $selected = ($view->event) ? ($view->event->getRestrictedEvent() == '1') ? 'selected' : ''  : ''; ?>>Privado</option>
                            <option value="2"  <?php echo $selected = ($view->event) ? ($view->event->getRestrictedEvent() == '2') ? 'selected' : ''  : ''; ?>>Publico</option>                    
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>
                        <?php $pass = ($view->event) ? $view->event->getPassword() : ''; ?>
                        <label for="passEvent">Contrase&ntilde;a : </label>
                    </td>
                    <td>
                        <input type="password" name="passEvent" value="<?php echo $pass; ?>" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <?php $pass = ($view->event) ? $view->event->getPassword() : ''; ?>
                        <label for="typeEvent">Tipo de evento : </label>
                    </td>
                    <td>
                        <select name="typeEvent" class="select-medium">
                            <option value="1"  <?php echo $selected = ($view->event) ? ($view->event->getRestrictedEvent() == '1') ? 'selected' : ''  : ''; ?>>BODAS </option>
                            <option value="2"  <?php echo $selected = ($view->event) ? ($view->event->getRestrictedEvent() == '2') ? 'selected' : ''  : ''; ?>>XV A&Ntilde;OS </option>                    
                        </select>
                    </td>
                </tr>
                <tr>
                    <?php $title = ($view->event) ? "Modificar " : "Agregar" ?>
                    <td><input type="submit" value="<?php echo $title; ?>" /></td>
                </tr>
            </table>
        </form>
    </div>
</div>

<input type="hidden" id="bdc-ajax-url" value="<?php echo $view->url(array('module' => 'EventAdmin', 'controller' => 'Users', 'action' => 'axImport')); ?>"/>
